/*     */ package com.umeng.common.net;
/*     */ 
/*     */ import android.app.Notification;
/*     */ import android.app.NotificationManager;
/*     */ import android.content.Context;
/*     */ import android.os.Bundle;
/*     */ import android.os.Handler;
/*     */ import android.os.Message;
/*     */ import android.os.Messenger;
/*     */ import android.os.RemoteException;
/*     */ import android.util.SparseArray;
/*     */ import android.widget.RemoteViews;
/*     */ import com.umeng.common.Log;
/*     */ import com.umeng.common.a.a;
/*     */ import java.util.Map;
/*     */ 
/*     */ class g
/*     */   implements DownloadingService.a
/*     */ {
/*     */   g(DownloadingService paramDownloadingService)
/*     */   {
/*     */   }
/*     */ 
/*     */   public void a(int paramInt)
/*     */   {
/* 359 */     if (DownloadingService.c().indexOfKey(paramInt) >= 0) {
/* 360 */       d.a locala = (d.a)DownloadingService.c().get(paramInt);
/* 361 */       long[] arrayOfLong = locala.f;
/* 362 */       int i = 0;
/* 363 */       if ((arrayOfLong != null) && (arrayOfLong[1] > 0L)) {
/* 364 */         float f = (float)arrayOfLong[0] / (float)arrayOfLong[1];
/* 365 */         i = (int)(f * 100.0F);
/*     */ 
/* 367 */         if (i > 100) i = 99;
/*     */       }
/*     */ 
/* 370 */       Notification localNotification = DownloadingService.a(this.a).a(this.a, locala.e, paramInt, i);
/* 371 */       locala.b = localNotification;
/*     */ 
/* 373 */       DownloadingService.c(this.a).notify(paramInt, localNotification);
/*     */     }
/*     */   }
/*     */ 
/*     */   public void a(int paramInt1, int paramInt2)
/*     */   {
/* 379 */     if (DownloadingService.c().indexOfKey(paramInt1) >= 0) {
/* 380 */       d.a locala = (d.a)DownloadingService.c().get(paramInt1);
/* 381 */       a.a locala1 = locala.e;
/* 382 */       Notification localNotification = locala.b;
/* 383 */       localNotification.contentView.setProgressBar(
/* 384 */         a.b(DownloadingService.b(this.a)), 100, 
/* 385 */         paramInt2, false);
/* 386 */       localNotification.contentView.setTextViewText(
/* 387 */         a.a(DownloadingService.b(this.a)), 
/* 388 */         String.valueOf(paramInt2) + "%");
/*     */ 
/* 390 */       DownloadingService.c(this.a).notify(paramInt1, localNotification);
/* 391 */       Log.c(DownloadingService.a(), String.format(
/* 392 */         "%3$10s Notification: mNotificationId = %1$15s\t|\tprogress = %2$15s", new Object[] { 
/* 393 */         Integer.valueOf(paramInt1), Integer.valueOf(paramInt2), locala1.b }));
/*     */     }
/*     */   }
/*     */ 
/*     */   public void a(int paramInt, String paramString)
/*     */   {
/* 399 */     if (DownloadingService.c().indexOfKey(paramInt) >= 0) {
/* 400 */       d.a locala = (d.a)DownloadingService.c().get(paramInt);
/* 401 */       if (locala != null) {
/* 402 */         a.a locala1 = locala.e;
/* 403 */         Notification localNotification = locala.b;
/* 404 */         localNotification.contentView.setTextViewText(
/* 405 */           a.a(DownloadingService.b(this.a)), 
/* 406 */           String.valueOf(100) + "%");
/*     */ 
/* 408 */         c.a(DownloadingService.b(this.a)).a(locala1.a, 
/* 409 */           locala1.c, 100);
/*     */ 
/* 411 */         Bundle localBundle = new Bundle();
/* 412 */         localBundle.putString("filename", paramString);
/*     */ 
/* 416 */         if (locala1.a.equalsIgnoreCase("delta_update")) {
/* 417 */           localMessage = Message.obtain();
/* 418 */           localMessage.what = 6;
/* 419 */           localMessage.arg1 = 1;
/* 420 */           localMessage.obj = locala1;
/* 421 */           localMessage.arg2 = paramInt;
/* 422 */           localMessage.setData(localBundle);
/* 423 */           DownloadingService.d(this.a).sendMessage(localMessage);
/* 424 */           return;
/*     */         }
/* 426 */         Message localMessage = Message.obtain();
/* 427 */         localMessage.what = 5;
/* 428 */         localMessage.arg1 = 1;
/* 429 */         localMessage.obj = locala1;
/* 430 */         localMessage.arg2 = paramInt;
/* 431 */         localMessage.setData(localBundle);
/* 432 */         DownloadingService.d(this.a).sendMessage(localMessage);
/*     */ 
/* 437 */         localMessage = Message.obtain();
/* 438 */         localMessage.what = 5;
/* 439 */         localMessage.arg1 = 1;
/* 440 */         localMessage.arg2 = paramInt;
/* 441 */         localMessage.setData(localBundle);
/*     */         try
/*     */         {
/* 444 */           if (DownloadingService.b().get(locala1) != null) {
/* 445 */             ((Messenger)DownloadingService.b().get(locala1)).send(localMessage);
/*     */           }
/* 447 */           DownloadingService.a(this.a).a(DownloadingService.b(this.a), DownloadingService.c(), DownloadingService.b(), paramInt);
/*     */         } catch (RemoteException localRemoteException) {
/* 449 */           DownloadingService.a(this.a).a(DownloadingService.b(this.a), DownloadingService.c(), DownloadingService.b(), paramInt);
/*     */         }
/*     */       }
/*     */     }
/*     */   }
/*     */ 
/*     */   public void a(int paramInt, Exception paramException)
/*     */   {
/* 458 */     if (DownloadingService.c().indexOfKey(paramInt) >= 0) {
/* 459 */       d.a locala = (d.a)DownloadingService.c().get(paramInt);
/* 460 */       a.a locala1 = locala.e;
/* 461 */       Notification localNotification = locala.b;
/* 462 */       localNotification.contentView.setTextViewText(
/* 463 */         a.c(DownloadingService.b(this.a)), locala1.b + 
/* 464 */         DownloadingService.b(this.a).getString(com.umeng.common.a.c.h(DownloadingService.b(this.a))));
/* 465 */       DownloadingService.c(this.a).notify(paramInt, localNotification);
/* 466 */       DownloadingService.a(this.a).a(DownloadingService.b(this.a), DownloadingService.c(), DownloadingService.b(), paramInt);
/*     */     }
/*     */   }
/*     */ }

/* Location:           C:\Users\Administrator\Desktop\umeng_sdk.jar
 * Qualified Name:     com.umeng.common.net.g
 * JD-Core Version:    0.6.2
 */